package controllerLayer;

import java.io.IOException;


import modelLayer.Customer;
import modelLayer.CustomerRecords;

public class CustomerCtr {
	private CustomerRecords custrec;
	
public CustomerCtr() {
		custrec = CustomerRecords.getInstance();
	}

public void createCustomer(String id,String name, String address, String phoneNumber, double moneySpent, double discount) {
	custrec.createCustomer(id, name, address, phoneNumber, moneySpent, discount);
}

public Customer getCustomer(String custID) {
		return custrec.getCustomer(custID);
	}

public String findCustomer(String ID){
	
	return custrec.findCustomer(ID);
}

public void updateCustomer(String Id,String address,String phoneNumber,double discount){
	custrec.updateCustomer(Id, address, phoneNumber, discount);
}

public void buyItem(String ID,String name,double quantity,String id2, double discount){
	custrec.buyItem(ID, name, quantity, id2, discount);
}

public void deleteCustomer(String Id){
	custrec.deleteCustomer(Id);
}
public void save() throws IOException{
	custrec.save();
}

}


